<?php
defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
if($_RQ['op']=='get'){
	$return['item']=$this->plugin_setting('setting');
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '基本信息',
		  'edits' => 
		  array (
		    0 => 
		    array (
		      'title' => '基本信息',
		      'list' => 
		      array (
				array ('name' => 'title','type' => 'string','title' => '名称'),
		        array ('name' => 'city','type' => 'pcd','options'=>'pcd','title' => '选择地区'),
				array ('name' => 'xieyi','type' => 'radio','title' => '选择协议','options'=>'xieyi'),
				array ('name' => 'type1','type' => 'radio','title' => '选择服务类别','show'=>array('xieyi'=>1),'options'=>'type'),
				array ('name' => 'type2','type' => 'radio','title' => '选择服务类别','show'=>array('xieyi'=>2),'options'=>'type2'),
				array ('name' => 'sevices1','type' => 'checkbox','title' => '选择服务','options'=>'sevices1','show'=>array('type2'=>1)),
				array ('name' => 'sevices2','type' => 'checkbox','title' => '选择服务','options'=>'sevices2','show'=>array('type2'=>2)),
				array ('name' => 'sevices3','type' => 'checkbox','title' => '选择服务','options'=>'sevices3','show'=>array('type2'=>3)),
				array ('name' => 'sevices4','type' => 'checkbox','title' => '选择服务','options'=>'sevices4','show'=>array('type2'=>4)),
				array ('name' => 'sevices5','type' => 'checkbox','title' => '选择服务','options'=>'sevices5','show'=>array('type2'=>5)),
				array ('name' => 'sevices6','type' => 'checkbox','title' => '选择服务','options'=>'sevices6','show'=>array('type2'=>6)),
				
		      ),
		    ),
		  ),
		);
	$return['pcd']=cfc('tools')->pcd();
	$return['type2']=array('1'=>'生活','2'=>'旅行','3'=>'娱乐','4'=>'工具','5'=>'知识','6'=>'其它',);
	$return['type']=array('1'=>'时间相关协议','2'=>'地点相关协议','3'=>'数字相关协议');
	$return['xieyi']=array('1'=>'通用协议','2'=>'垂直服务协议');
	$return['sevices1']=array('1'=>'餐馆服务','2'=>'地图服务','3'=>'周边服务','4'=>'团购服务');
	$return['sevices2']=array('1'=>'酒店服务','2'=>'旅游服务','3'=>'航班服务','4'=>'火车服务');
	$return['sevices3']=array('1'=>'电影服务','2'=>'音乐服务','3'=>'视频服务','4'=>'小说服务');
	$return['sevices4']=array('1'=>'天气服务','2'=>'股票服务','3'=>'提醒服务','4'=>'常用电话服务');
	$return['sevices5']=array('1'=>'菜谱服务','2'=>'百科服务','3'=>'咨询服务');
	$return['sevices6']=array('1'=>'电视节目预告','2'=>'通用指令','3'=>'电视指令','4'=>'车载指令','5'=>'应用服务','6'=>'网址服务','7'=>'网页搜索');
	
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$this->plugin_setting('setting',$postdata);
	exi('设置成功！','','/setting/show');
}
if($_RQ['op']=='show'){
	$postdata=$this->plugin_setting('setting');
	$set='$setting';
	$query='$query';
	$openid='$openid';
	$return['item']['text']="cfc('jy_wxsemantic')->post($set,$query,$openid)";
	$return['item']['setting']=json_encode($postdata);
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '接口调用方法',
		  'edits' => 
		  array (
		    0 => 
		    array (
		      'title' => '接口调用方法',
		      'list' => 
		      array (
				array ('name' => 'text','type' => 'string','title' => '插件调用方法为','help'=>'$query为关键字，$openid为用户openid','read'=>true),
		        array ('name' => 'setting','type' => 'text','help'=>'需要用json_decode转化为数组再入参','title' => '$setting的值','read'=>true),
		      ),
		    ),
		  ),
		);
		exi($return);
}
?>